package com.ytjj.qmyx.admin.dao.channel;


import com.ytjj.qmyx.admin.model.request.YxAssignFreight;
import com.ytjj.qmyx.admin.model.request.YxAstrictRegion;
import com.ytjj.qmyx.admin.model.request.YxFreightTemplate;
import com.ytjj.qmyx.admin.model.request.channel.FreightTemplateEntity;
import com.ytjj.qmyx.admin.model.response.ProductDataResponse;
import com.ytjj.qmyx.admin.model.response.goods.FreightTemplateResponse;
import com.ytjj.qmyx.admin.model.response.goods.YxAssignFreightResponse;
import com.ytjj.qmyx.mall.model.YxAstrictRegionResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

/**
 * 运费模板表
 * 
 *
 * @email 
 * 
 */
@Mapper
public interface FreightTemplateDao  {

    List<FreightTemplateEntity> queryList(FreightTemplateEntity freightTemplate);

    /**
     * 查询运费模板
     * @return
     */
    Integer selectFreightTemplates(@Param("templateName") String templateName, @Param("bankerId")Integer bankerId);


    /**
     * 新增运费模板主表
     * @param yxFreightTemplate
     * @return
     */
    Integer insertFreightTemplate(YxFreightTemplate yxFreightTemplate);

    /**
     * 新增指定运费
     * @param yxAssignFreightList
     * @param id
     * @return
     */
    Integer insertAssignFreightList(@Param("yxAssignFreightList") List<YxAssignFreight> yxAssignFreightList, @Param("id") Integer id);

    /**
     * 新增限制下单区域
     * @param yxAstrictRegion
     * @param id
     * @return
     */
    Integer insertAstrictRegion(@Param("yxAstrictRegion") YxAstrictRegion yxAstrictRegion, @Param("id") Integer id);


    /**
     * 删除运费模板消息
     * @param id
     * @return
     */
    Integer deleteFreightTemplate(@Param("id") Integer id);

    /**
     * 删除指定运费
     * 根据运费模板id
     * @param id
     * @return
     */
    Integer deleteAssignFreightList(@Param("id") Integer id);

    /**
     * 删除限制下单区域
     * 根据运费模板id
     * @param id
     * @return
     */
    Integer deleteAstrictRegionList(@Param("id") Integer id);

    /**
     * 删除指定运费
     * 根据自身id
     * @param id
     * @return
     */
    Integer deleteAssignFreight(@Param("id") Integer id);


    /**
     * 删除限制下单区域
     * 根据自身id
     * @param id
     * @return
     */
    Integer deleteAstrictRegion(@Param("id") Integer id);

    /**
     * 修改指定运费
     * 地区
     * @param yxAssignFreight
     * @return
     */
    Integer updateAssignFreight(@Param("yxAssignFreight") YxAssignFreight yxAssignFreight);

    /**
     * 修改限制下单区域
     * 地区
     * @param yxAstrictRegion
     * @return
     */
    Integer updateAstrictRegion(@Param("yxAstrictRegion") YxAstrictRegion yxAstrictRegion);


    /**
     * 修改运费模板
     * 地区
     * @param yxFreightTemplate
     * @return
     */
    Integer updateFreightTemplate(@Param("yxFreightTemplate") YxFreightTemplate yxFreightTemplate);

    /**
     * 修改默认
     * @return
     */
    Integer updateDefaults(@Param("platformData")String platformData);

    /**
     * 修改默认
     */
    Integer updateDefault(Integer id);


    FreightTemplateResponse selectFreightTemplateResponse(Integer id);

    List<YxAssignFreightResponse> queryYxAssignFreightResponseByFreightId(Integer id);

    FreightTemplateResponse selectBySupplyTemplateIdAndPlatformData(@Param("supplyTemplateId") Integer supplyTemplateId, @Param("platformData") String platformData, @Param("freightType")Integer  freightType);

    List<FreightTemplateResponse> selectFreightTemplatePage(@Param("templateName")String templateName, @Param("platformData")String  platformData, @Param("freightType")Integer  freightType);

    List<YxAssignFreightResponse> queryYxAssignFreightByFreightId(@Param("id") Integer id, @Param("templateIdList") List<Integer> templateIdList);

    List<ProductDataResponse> queryProductDataResponse(Integer id);

    List<YxAstrictRegionResponse> queryRegionList();

    int updateYxAstrictRegionId(@Param("id") Integer id , @Param("regionId")String regionId);
}